﻿using System.Collections.Generic;
using System.Threading.Tasks;
using AbpOne.Domain.Blog;
using AbpOne.Domain.Blog.Repositories;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace AbpOne.EntityFrameworkCore.Repositories.Blog {
    public class PostTagRepository : EfCoreRepository<AbpOneDbContext, PostTag, int>, IPostTagRepository {
        public PostTagRepository(IDbContextProvider<AbpOneDbContext> dbContextProvider) : base(dbContextProvider) {
        }

        /// <summary>
        /// 批量插入
        /// </summary>
        /// <param name="postTags"></param>
        /// <returns></returns>
        public async Task BulkInsertAsync(IEnumerable<PostTag> postTags) {
            await DbContext.Set<PostTag>().AddRangeAsync(postTags);
            await DbContext.SaveChangesAsync();
        }
    }
}